package springapp.web;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/footer.htm")
public class FooterController {
	@RequestMapping(method = RequestMethod.GET)
	public ModelAndView showUserForm() {
		Map<String, Object> myModel = new HashMap<String, Object>();
		myModel.put("now", new Date());
		myModel.put("username", SecurityContextHolder.getContext()
				.getAuthentication().getName());
		return new ModelAndView("footer", "model",
				myModel);
	}
}
